﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using BKH.MyUserControl.UCMenu;
using BKH.MyUserControl.UCHienThi;
<<<<<<< .mine
using BKH.MyUserControl;
using BKH.BLL.BussinuessCommon;
=======
using BKH.MyUserControl;
>>>>>>> .r21


namespace BKH
{
    public partial class frmHome : Form
    {
        public frmHome(int iduser)
        {
            InitializeComponent();
<<<<<<< .mine
            this.iduser = iduser;
            checkQuyen();
            
=======
<<<<<<< .mine
            
=======
<<<<<<< .mine
            
=======
            gbHienThi.Controls.Clear();
            gbHienThi.Controls.Add(new ucNhaCungCap());
>>>>>>> .r19
>>>>>>> .r20
>>>>>>> .r21

            
        }
        int iduser;
        private void splitContainer1_Panel2_Paint(object sender, PaintEventArgs e)
        {

        }

        private void pcNhanSu_Click(object sender, EventArgs e)
        {
<<<<<<< .mine
            bgWelcom.Controls.Clear();
            ucChucNangNhanSu ucnv = new ucChucNangNhanSu();
            bgWelcom.Controls.Add(ucnv);

            gbHienThi.Controls.Clear();
            ucQuanLyNhanVien ucNV = new ucQuanLyNhanVien();
            gbHienThi.Controls.Add(ucNV);
=======
            bgWelcom.Controls.Clear();
            ucChucNangNhanSu ucnv = new ucChucNangNhanSu();
            bgWelcom.Controls.Add(ucnv);

            gbHienThi.Controls.Clear();
            ucHienThiNhanVien ucNV = new ucHienThiNhanVien();
            gbHienThi.Controls.Add(ucNV);
>>>>>>> .r21
            
        }

        void checkQuyen()
        {
            NamGiuQuyen.NamQuyen = QuyenSuDung.GetQuyen(iduser);
            switch (NamGiuQuyen.NamQuyen)
            {
                case PhanQuyen.GiamDoc:
                    {
                        pcBenhNhan.Visible = true;
                        pcNhanSu.Visible = true;
                        pcVatTu.Visible = true;
                        pcUser.Visible = true;
                        
                        break;

                    }
                case PhanQuyen.QuanLyNhanSu:
                    {
                        pcBenhNhan.Visible = false;
                        pcNhanSu.Visible = true;
                        pcVatTu.Visible = false;
                        pcUser.Visible = false;
                        break;
                    }
                case PhanQuyen.ChargeNures:
                    {
                        pcBenhNhan.Visible = true;
                        pcNhanSu.Visible = false;
                        pcVatTu.Visible = false;
                        pcUser.Visible = false;
                        break;
                    }
                default:
                    {
                        pcBenhNhan.Visible = false;
                        pcNhanSu.Visible = false;
                        pcVatTu.Visible = false;
                        pcUser.Visible = false;
                        break;
                    }
            }
        }

        private void button1_Click(object sender, EventArgs e)
        {
            this.Close();
         
        }
<<<<<<< .mine

        private void frmHome_Load(object sender, EventArgs e)
        {

        }

        private void pcBenhNhan_Click(object sender, EventArgs e)
        {
            bgWelcom.Controls.Clear();
            UCChucNangBenhNhan ucbn = new UCChucNangBenhNhan();
            bgWelcom.Controls.Add(ucbn);

            gbHienThi.Controls.Clear();
            ucThemBenhNhan ucThemBN = new ucThemBenhNhan();
            gbHienThi.Controls.Add(ucThemBN);
        }

        private void pbUser_Click(object sender, EventArgs e)
        {
            bgWelcom.Controls.Clear();
            UCChucNangBenhNhan ucbn = new UCChucNangBenhNhan();
            bgWelcom.Controls.Add(ucbn);

            gbHienThi.Controls.Clear();
            ucQuanLyUser ucThemBN = new ucQuanLyUser();
            gbHienThi.Controls.Add(ucThemBN);
        }

        void LoadInit()
        {
 
        }
=======
<<<<<<< .mine

        private void frmHome_Load(object sender, EventArgs e)
        {

        }

        private void pcBenhNhan_Click(object sender, EventArgs e)
        {
            bgWelcom.Controls.Clear();
            UCChucNangBenhNhan ucbn = new UCChucNangBenhNhan();
            bgWelcom.Controls.Add(ucbn);

            gbHienThi.Controls.Clear();
            UCHienThiDanhSachBN ucThemBN = new UCHienThiDanhSachBN();
            gbHienThi.Controls.Add(ucThemBN);
            
        }

        private void pbUser_Click(object sender, EventArgs e)
        {
            bgWelcom.Controls.Clear();
            UCChucNangBenhNhan ucbn = new UCChucNangBenhNhan();
            bgWelcom.Controls.Add(ucbn);

            gbHienThi.Controls.Clear();
            ucQuanLyUser ucThemBN = new ucQuanLyUser();
            gbHienThi.Controls.Add(ucThemBN);
        }
=======

        private void frmHome_Load(object sender, EventArgs e)
        {

        }

        private void pcBenhNhan_Click(object sender, EventArgs e)
        {
            bgWelcom.Controls.Clear();
            UCChucNangBenhNhan ucbn = new UCChucNangBenhNhan();
            bgWelcom.Controls.Add(ucbn);

            gbHienThi.Controls.Clear();
            ucThemBenhNhan ucThemBN = new ucThemBenhNhan();
            gbHienThi.Controls.Add(ucThemBN);
        }
>>>>>>> .r20
>>>>>>> .r21
    }
}
